package baiwa.rta.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import baiwa.rta.dao.ManageProjectDao;
import baiwa.rta.dao.Impl.SQLWhere;
import baiwa.rta.model.DataTableModel;
import baiwa.rta.model.ManageProjectModel;
import baiwa.rta.service.ManageProjectService;
/**
 * 
 * @author Praijittra K.
 * @date 7 Mar 2014
 *
 */
@Service("ManageProjectService")
@Transactional(readOnly = false)
public class ManageProjectServiceImpl implements ManageProjectService {

	@Autowired
	ManageProjectDao dao;
	
	@Override
	public boolean save(ManageProjectModel model) {
		return dao.save(model);
	}

	@Override
	public boolean delete(Integer... ids) {
		for(Integer id : ids){
			dao.delete(id);
		}
		return true;
	}

	@Override
	@Transactional(readOnly = true)
	public ManageProjectModel findByID(Integer id) {
		return dao.findByID(id);
	}

	@Override
	@Transactional(readOnly = true)
	public List<ManageProjectModel> findALL() {
		return dao.findALL();
	}

	@Override
	public boolean update(ManageProjectModel model) {
		return dao.update(model);
	}

	@Override
	public DataTableModel<ManageProjectModel> limit(SQLWhere[] sqlWheres,
			String[] sqlOrderBys, int page, int perPage) {
		return dao.limit(sqlWheres, sqlOrderBys, page, perPage);
	}

}
